package guoanmaker.personal.business.service;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import guoanmaker.personal.business.model.PersonalChannelstatistics;
import guoanmaker.personal.business.repository.PersonalChannelstatisticsRepository;

@Service
public class PersonalChannelstatisticsService implements PersonalChannelstatisticsServiceInterface {

	@Autowired
	private PersonalChannelstatisticsRepository personalChannelstatisticsRepository;
	
	@Override
	public int saveChannelstatistics(int channel, int platform) {
		PersonalChannelstatistics ppersonalChannelstatistics=new PersonalChannelstatistics();
		ppersonalChannelstatistics.setChannel(channel);
		ppersonalChannelstatistics.setPlatform(platform);
		ppersonalChannelstatistics.setCreatedate(new Date());
		personalChannelstatisticsRepository.save(ppersonalChannelstatistics);
		return 1;
	}

	
}
